package cn.com.nes.site.service.system.role.impl;

import cn.com.nes.mybatis.agent.system.entity.TRole;
import cn.com.nes.mybatis.agent.system.mapper.TRoleMapper;
import cn.com.nes.site.entity.em.DeleteEnum;
import cn.com.nes.site.service.system.role.SystemRoleService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class SystemRoleServiceImpl extends ServiceImpl<TRoleMapper, TRole> implements SystemRoleService {

    @Override
    public TRole getERUserRole(String companyId) {
        QueryWrapper<TRole> wrapper = new QueryWrapper<>();
        wrapper.eq("companyId", companyId);
        wrapper.eq("sfsc", DeleteEnum._0.getKey());
        wrapper.eq("name", "易修人员角色");
        return this.getOne(wrapper);
    }

}
